package com.frost;

import com.frost.bean.DemoBean;
import com.frost.configs.ProfileConfig;
import com.frost.controller.SampleController;
import com.frost.event.DemoPublish;
import com.frost.service.AsyncTaskService;
import com.frost.service.BeanWayService;
import com.frost.configs.ELConfig;
import com.frost.service.JSR250WayService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
public class OoApplication {

	public static void main(String[] args) {
		SpringApplication.run(OoApplication.class, args);
//		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
//		ELConfig elConfig = (ELConfig) ctx.getBean(ELConfig.class);
//		elConfig.output();
//
//		BeanWayService beanWayService = ctx.getBean(BeanWayService.class);
//		JSR250WayService jsr250WayService = ctx.getBean(JSR250WayService.class);

//		ctx.getEnvironment().setActiveProfiles("prod");
//		ctx.register(ProfileConfig.class);
//		ctx.refresh();
//		DemoBean bean = ctx.getBean(DemoBean.class);
//		System.out.println(bean.getEnvname());


//		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext("com.frost");
//		DemoPublish publish = ctx.getBean(DemoPublish.class);
//		publish.publish("Hello i send msg");
//		ctx.close();

//		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext("com.frost");
//		AsyncTaskService taskService = ctx.getBean(AsyncTaskService.class);
//		taskService.executeAsyncTask2(1);
//		taskService.executeAsyncTask2(2);
//		ctx.close();
	}
}
